﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ARS.Control.Custom.Entity.Widget;
using ARS.Fields;

namespace NetWebControl.ControlTest.MySqlFund
{
    /// <summary>
    /// _EntitySave 的摘要说明
    /// </summary>
    public class _EntitySave : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
//            context.Response.ContentType = "text/plain";
//            context.Response.Write("Hello World");
            EntityModifyPanel entityModifyPanel = new EntityModifyPanel();
            entityModifyPanel.Entity = new fund_cost();
            entityModifyPanel.RequestKey = "Id";
            entityModifyPanel.IsEncryptKey = false;
            string message=null;
            entityModifyPanel.ShowDialog = (Type, msg) =>
            {
                message = msg;
            };
            //string msg = entityModifyPanel.ShowDialog();
            entityModifyPanel.AddOrUpdateEntityToDb();
            context.Response.Write(message);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}